<?
require("config.php");

$location_status .= "| Add";
$show_backnav = "menu";
$menutype = 2;

if (NULL!=$action){

	if ($Payment_method=="Other") $Payment_method=$Other;

   $field = array(
	"code",
	"course",
	"schedule",
	"date",
	"firstname",
	"famiry_name",
	"phone",
	"fax",
	"address",
	"city",
	"country",
	"email",
	"profession",
	"education",
	"enroller",
	"enroller_method",
	"amount",
	"payment_method",
	"cardtype",
	"cardname",
	"cardno",
	"expiration",
	);


   $content = array(
	$Code,
	$Course,
	$Schedule,
	"$Year-$Month-$Day",
	$Firstname,
	$Famiry_name,
	$Tel,
	$Fax,
	$Address,
	$City,
	$Country,
	$Email,
	$Profession,
	$Education,
	$Enroller,
	$Enroller_method,
	$Amount,
	$Payment_method,
	$Cardtype,
	$Cardname,
	$Cardno,
	"$myYear-$myMonth-$myDay",
	);

   myInsert($table,$field,$content);


   header("location:" . $rela_path . "share/msg.php?v=751&id=$parent_id&label=$Schedule");

   exit();

}

if (checkCode($table,$Code)){

	header("location:" . $rela_path . "share/msg.php?v=9001");
	exit();
}


require($rela_path . "inc/header.php");
require($rela_path . "bin/date.php");
require($rela_path . "bin/country.php");

?> 
<form name="form1" method="post" action="">
<!--hidden filed-->
<input name="action" type="hidden" value="add">
<input name="Code" type="hidden" value="<?print($Code)?>">

  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image" type="image" onclick="Redirect('menu.php?label=<?=$label?>&id=<?=$parent_id?>',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image" type="image" src="../../images/bt_save.gif" width="76" height="22"  <?print($active)?>> 
      </td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right">&nbsp; </td>
    </tr>
    <tr> 
      <td><table border="0">


          <tr> 
            <td class="tdheader">Course :</td>
            <td>

<?

$Query="Select code, course, name from course_schedule where id = '$parent_id'";

$r=myQuery($Query);


echo $r[0][1];
?> 

			  
			  </td>
          </tr>

          <tr> 
            <td class="tdheader">Schedule :</td>
            <td>

<?=$r[0][2]?>

<input type="hidden" name="Course" value="<?=$r[0][1]?>">
<input type="hidden" name="Schedule" value="<?=$r[0][2]?>">			  
<input type="hidden" name="parent_id" value="<?=$parent_id?>">				  
			  </td>
          </tr>


    <tr> 
      <td align="right">&nbsp; </td>
    </tr>




          <tr> 
            <td class="tdheader">Enrol Date :</td>
            <td><?=FFPdate(date("Y-m-d"))?></td>
          </tr>
          <tr> 
            <td width="128" class="tdheader">First Name :</td>
            <td width="523"> <input name="Firstname" type="text" class="text" size="30"> </td>
          </tr>
          <tr> 
            <td class="tdheader">Family Name : </td>
            <td><input name="Famiry_name" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Tel :</td>
            <td><input name="Tel" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Fax :</td>
            <td><input name="Fax" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Address :</td>
            <td><textarea name="Address" cols="40" rows="4" class="text"></textarea></td>
          </tr>



          <tr> 
            <td class="tdheader">City :</td>
            <td><input name="City" type="text" class="text" size="30"></td>
          </tr>



          <tr> 
            <td class="tdheader">Country :</td>
            <td><?FFPCountry("HONG KONG");?></td>
          </tr>


          <tr> 
            <td class="tdheader">E-mail :</td>
            <td><input name="Email" type="text" class="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Profession :</td>
            <td><input name="Profession" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Education :</td>
            <td><input name="Education" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Enroller :</td>
            <td><input name="Enroller" type="text" class="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Enrol Method :</td>
            <td>

<?

$sourceData = array(
  "Online",
  "Offline",
  );


FFPCheckBox("Enroller_method",$Status,$sourceData,$sourceLabel);

?>
			  
			  </td>
          </tr>
          <tr> 
            <td class="tdheader">Amount :</td>
            <td><input name="Amount" type="text" class="text" size="30"></td>
          </tr>
          <tr> 
            <td class="tdheader">Payment Method :</td>
            <td><input type="radio" name="Payment_method" value="Credit Card" CHECKED>
              Credit Card 
              <input type="radio" name="Payment_method" value="Mail Check">
              Mail Check 
              <input type="radio" name="Payment_method" value="Other">
              Other 
              <input name="Other" type="text" class="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Credit Card Type :</td>
            <td>
			
<?

$sourceData = array(
  "Visa",
  "American Express",
  "Master",
  );

FFPSelectBox("Cardtype",$Status,$sourceData,$sourceLabel);

?>		
			  
			  
			  </td>
          </tr>
          <tr> 
            <td height="25" class="tdheader">Credit Card Name :</td>
            <td><input name="Cardname" type="text" class="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Credit Card No. :</td>
            <td><input name="Cardno" type="text" class="text" size="40"></td>
          </tr>
          <tr> 
            <td class="tdheader">Expiration Date :</td>
            <td><?=FFPtime(Date("Y-m-d"))?></td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </table>
  <table width="95%" border="0" align="center">
    <tr> 
      <td align="right"> <input name="image2" type="image" onclick="Redirect('menu.php?label=<?=$label?>',1);return false;" src="../../images/bt_cancel.gif" width="78" height="23"> 
        <input name="image2" type="image" src="../../images/bt_save.gif" width="76" height="22" <?print($active)?>> 
      </td>
    </tr>
  </table>
</form>
<?
require($rela_path . "inc/footer.php");
?>

